package cn.sgrand.web.controller;

import cn.sgrand.ioc.service.SysuserService;
import cn.sgrand.pojo.Sysuser;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * Created by ggj on 2016/12/6.
 */

@Controller
public class SysuserController {


    @Resource
    private SysuserService sysuserService;

    @RequestMapping("/authSysuser")
    @ResponseBody
    public boolean AuthSysuser(Sysuser sysuser, HttpServletRequest request){
            if(sysuserService.authSysuser(sysuser)){
                HttpSession session=request.getSession();
                session.setAttribute("sysuser",sysuser);
                return true;
            }
        return false;
    }


}
